package expand.shikh.com.customview;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import expand.shikh.com.customview.keyboard.EditKeyBoardActivity;
import expand.shikh.com.customview.keyboard.KeyBoardActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.tv_keyboard).setOnClickListener(this);
        findViewById(R.id.tv_scroll_keyboard).setOnClickListener(this);
    }
    Intent intent;
    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tv_keyboard:
                intent = new Intent(MainActivity.this,KeyBoardActivity.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
                startActivity(intent);
                break;
            case R.id.tv_scroll_keyboard:
                intent = new Intent(MainActivity.this,EditKeyBoardActivity.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
                startActivity(intent);
                break;
        }
    }
}
